<?php slot('js_insideLoadFunction')?>
ADMIN_FORM.init();
<?php end_slot()?>
<div class="box-navigation">
	<?php echo $data['navigation']?>
</div>
<div class="clr"></div>
<div class="box-content">
	<form action="?action_name=<?php echo $data['action']?>" method="post" name="form_main" id="form_main">
		<?php echo $form['_csrf_token']?>
		<div class="clr"></div>
		<div class="box-content-main ">
			<div class="message"><?php echo empty($data['result'])?'':$data['result']?></div><div class="note">* is required.</div>
			<div class="clr"></div>
			<table class="table-list table-form" cellspacing="0" cellpadding="0" border="0">
				<tr class="class1">
					<td class="label"><?php echo __('label_name',null,'banners')?><span class="required">*</span></td>
					<td class="input">
						<?php echo $form['name']->render(array('class'=>'form-text required', 'data-require'=> 'not-empty'))?>
						<span class="error" id="type_error"><?php echo __('not_empty', null, 'table_list')?></span>
					</td>
					
				</tr>
                <tr class="class1">
					<td class="label"><?php echo __('label_photo_url',null,'banners')?></td>
					<td class="input">
						<span class="img-item">
						<?php echo $form['photo_url']->render(array('class'=>'form-text photo_url', 'type' => 'hidden'))?>
                        <img src="<?php echo $data['photo_url']; ?>" class="upload-preview" data-id="Banners_photo_url"/>
						<?php if(intval($data['photo_remove'])):?>
							<a href="#" class="upload-remove" title="remove" alt="remove"></a>
						<?php endif;?>
						</span>
					</td>
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_description',null,'banners')?></td>
					<td class="input">
						<?php echo $form['description']->render()?>
					</td>
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_page_link',null,'banners')?><span class="required">*</span></td>
					<td class="input">
						<?php echo $form['page_link']->render(array('class'=>'required', 'data-require'=>'not-empty'))?>
						<span class="error" id="type_error"><?php echo __('not_empty', null, 'table_list')?></span>
					</td>
					
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('is_enabled',null,'table_list')?></td>
					<td class="input"><?php echo $form['is_enabled']->render(array('class'=>'required'))?></td>
					
				</tr>
				<tr class="class1" style="background:#fff">
					<td class="label">&nbsp;</td>
					<td class="input"><input type="button" id="button_submit" name="button_submit" class="button" value="<?php echo $data['button_action']?>"/></td>
					
				</tr>
			</table>
		</div>
		<div class="clr"></div>
		<div class="control-back"><a href="<?php echo $data['redirect']?>" title="<?php echo __('control_back', null, 'table_list')?>" alt="<?php echo __('control_back', null, 'table_list')?>"><?php echo __('control_back', null, 'table_list')?></a></div>
	</form>
</div>
<script>
function deletePhoto(){
    $('input.photo_url').val('');
    $('#img_preview').attr('src','<?php echo sfconfig::get('app_uploadControl_no_image'); ?>');
}
</script>